<%@ page language="java" import="java.util.*,java.lang.*"
	pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<meta charset="utf-8">
<head>
<title>${appname}</title>
<%@ include file="/WEB-INF/view/common/taglibs.jsp"%>
<%@ include file="/WEB-INF/view/common/css_js_ace.jsp"%>
<script type="text/javascript">
	$(function() {
		$('#inputForm input').tooltip();
		//表单验证
		$('#inputForm').checkForm();
		$('#inputForm').ajaxForm(
				{
					url : _ctx + "/usermgr/node_mgr_user.do",
					type : "post",
					dataType : "json",
					beforeSubmit : function() {
						var checkReturn = $('#inputForm')
								.checkForm(null, false);
						if (checkReturn) {
							$("#sbmBtn").attr("disabled", "disabled");
						}
						return checkReturn;
					},
					clearForm : false,
					resetForm : false,
					success : function(resp) {
						if (resp.status == '1') {
							parent.ui.msg(resp.msg, 1);
							ui.go(_ctx + '/pub/sysmgr/usermgr/user_list.do');
						} else {
							parent.ui.msg(resp.msg, 0);
							$("#sbmBtn").removeClass("disabled").attr(
									"disabled", null);
						}
					},
					error : function(resp) {
						parent.ui.msg('请求发送失败', 0);
						$("#sbmBtn").removeClass("disabled").attr("disabled",
								null);
					}
				});
	});
</script>
</head>
<body>
	<div class="main-container" id="main-container">
		<div class="main-container-inner">
			<div class="main-content" style="margin-left: 0px;">
				<div class="breadcrumbs" id="breadcrumbs">
					<ul class="breadcrumb">
						<li><i class="icon-home home-icon"></i> 系统管理</li>
						<li>用户管理</li>
						<li class="active">用户节点权限配置</li>

					</ul>
				</div>
				<div class="page-content">
					<div class="row">
						<div class="col-xs-12">
							<div class="widget-main">
								<div class="widget-box" style="border-bottom: 0;">
									<div class="widget-header widget-header-flat">
										<div class="widget-toolbar no-border">
											<a class="btn btn-primary btn-xs"
												href="${ctx}/pub/sysmgr/usermgr/user_list.do"><i
												class="icon-arrow-left"></i> 返回&nbsp;&nbsp;</a>
										</div>
									</div>
									<form class="form-horizontal" role="form" id="inputForm"
										action="${ctx}/usermgr/node_mgr_user.do" method="post">
										<div class="widget-box transparent">
											<div class="widget-body">
												<div class="widget-main no-padding-left no-padding-right">
													<div class="row">
														<div class="table-responsive">
															<div class="row">
																<div class="col-xs-12">
																	<div class="widget-main">
																		<input type="hidden" name="id" value="${vo.id}" />
																		<div
																			class="profile-user-info profile-user-info-striped"
																			id="userInfo">
																			<div class="profile-info-row" style="height: 45px;">
																				<div class="profile-info-name"
																					style="padding-top: 15px;">用户名称</div>
																				<div class="profile-info-value"
																					style="padding-top: 15px;">
																					<span class="editable">${vo.userName}&nbsp;</span>
																				</div>
																			</div>
																			<div class="profile-info-row" style="height: 45px;">
																				<div class="profile-info-name"
																					style="padding-top: 15px;">权限</div>
																				<div class="profile-info-value"
																					style="padding-top: 10px;">
																					<label> <input type="radio" class="ace"
																						name="ext1" id="ext1" value="1"
																						<c:if test="${'1' == vo.ext1 }">checked="checked"</c:if> />
																						<span class="lbl">管理</span>
																					</label>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <label>
																						<input type="radio" class="ace" name="ext1"
																						value="0" id="ext1"
																						<c:if test="${'0' == vo.ext1 }">checked="checked"</c:if> />
																						<span class="lbl">查看</span>
																					</label>
																				</div>
																			</div>
																			<div class="profile-info-row">
																				<div class="profile-info-name"
																					style="padding-top: 15px;">节点</div>
																				<div class="profile-info-value">
																					<div
																						style="width: 50%; height: 300px; overflow: scroll;">
																						<c:forEach var="type" items="${orgTypeList}">
																							<p
																								style="border-bottom: 1px solid #000; margin: 0; padding: 5px 0;">${type.orgName}</p>
																							<div style="padding: 5px 0;">
																								<c:forEach var="region" items="${nodeList}">
																									<c:if
																										test="${fn:startsWith(region.orgcode,fn:substring(type.orgcode,0,2))}">
																										<label> <input type="checkbox"
																											class="ace" name="ext2" value="${region.id}"
																											<c:if test="${fn:contains(vo.ext2,region.id)}">checked</c:if> />
																											<span class="lbl">${region.name}&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span>
																										</label>
																									</c:if>
																								</c:forEach>
																							</div>
																						</c:forEach>
																					</div>
																				</div>
																			</div>
																		</div>
																	</div>
																</div>
															</div>
														</div>
													</div>
												</div>
											</div>
										</div>

										<hr>
										<div class="clearfix form-group">
											<div class="col-md-offset-5 col-md-7">
												<button id="sbmBtn" type="submit"
													class="btn btn-sm btn-info" id="sbmBtn">
													<i class="icon-ok bigger-110"></i>保存
												</button>
											</div>
										</div>
									</form>
								</div>
							</div>
						</div>
					</div>
				</div>
			</div>
		</div>
	</div>
</body>
</html>